﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Bmpe : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //UserName.Text = Profile.Name;
        //LastName.Text = Profile.LastName;
        //Patronymic.Text =  Profile.Patronymic;
        //Calendar1.SelectedDate = Profile.DateBirdth;
        //AreaTB.Text = Profile.Area;

        //VkTB.Text = Profile.Vk;
        //FBTB.Text = Profile.Facebook;
        //TelTB.Text = Profile.TelNum;
        //OthTB.Text =  Profile.OtherInfo;
        //MSTB.Text = Profile.Myspace;
        //GpTB.Text =  Profile.GooglePl;
        //TwTB.Text = Profile.Twitter;
    }

    protected void ExtInfoButton_Click(object sender, EventArgs e)
    {
        RegProfileMultiView.ActiveViewIndex = 0;

    }

    protected void ContactInfoButton_Click(object sender, EventArgs e)
    {
        RegProfileMultiView.ActiveViewIndex = 1;

    }

    protected void SaveChangeButton_Click(object sender, EventArgs e)
    {
        //ProfileCommon curUs = Profile.GetProfile(HttpContext.Current.User.Identity.Name);
        //curUs.LastName = 
        if (RegProfileMultiView.ActiveViewIndex == 0)
        {
            Profile.Name = UserName.Text;
            Profile.LastName = LastName.Text;
            Profile.Patronymic = Patronymic.Text;
            Profile.DateBirdth = Calendar1.SelectedDate;
            Profile.Area = AreaTB.Text;
        }

        if (RegProfileMultiView.ActiveViewIndex == 1)
        {
            Profile.Vk = VkTB.Text;
            Profile.Facebook = FBTB.Text;
            Profile.TelNum = TelTB.Text;
            Profile.OtherInfo = OthTB.Text;
            Profile.Myspace = MSTB.Text;
            Profile.GooglePl = GpTB.Text;
            Profile.Twitter = TwTB.Text;
        }


        Profile.Save();
    }
}